void main() {
  final value = 0x22;
  final bitmask = 0x0f;

  assert((value & bitmask) == 0x02); // AND
  print('(value & bitmask) == 0x02: ${value & bitmask}');
  assert((value & ~bitmask) == 0x20); // AND NOT
  print('(value & ~bitmask) == 0x20: ${value & ~bitmask}');
  assert((value | bitmask) == 0x2f); // OR
  print('(value | bitmask) == 0x2f: ${value | bitmask}');
  assert((value ^ bitmask) == 0x2d); // XOR
  print('(value ^ bitmask) == 0x2d: ${value ^ bitmask}');
  assert((value << 4) == 0x220); // Shift left
  print('(value << 4) == 0x220: ${value << 4}');
  assert((value >> 4) == 0x02); // Shift right
  print('(value >> 4) == 0x02: ${value >> 4}');
  assert((-value >> 4) == -0x03);
  print('(-value >> 4) == -0x03: ${-value >> 4}');
  assert((value >>> 4) == 0x02); // Unsigned shift right
  print('(value >>> 4) == 0x02: ${value >>> 4}');
  assert((-value >>> 4) > 0); // Unsigned shift right
  print('(-value >>> 4) > 0: ${-value >>> 4}');
}
